<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="${ctx}/css/common.css" />
<link rel="stylesheet" href="${ctx}/css/main.css" />
<jsp:include page="../inc.jsp"></jsp:include>
<meta http-equiv="X-UA-Compatible" content="edge" />
<style type="text/css"> 
	
</style>
		<script type="text/javascript">
		$(function(){
			//鼠标经过事件
			$(".hover").mouseover(function(){
				$(".hover").removeClass("active");
			    $(this).addClass("active");
			    $(".list").hide();
			    $(".list").eq($(this).index()-1).show();
			});
		
			//点击按照条件查询
			$("#query").click(function(){
				var deptCityName = "";
				var arrCityName = "";
				var deptCity="";//出发城市
				var arrCity="";//到达城市
				var deptDate="";//出发日期
				var seatClass="";//舱位
				var charterType="";//类型
				var routingType="";
				charterType=3;
				deptCityName=$("#homecity_name").val();
				arrCityName=$("#getcity_name").val();
				deptCity=$("#startCity").val();
				arrCity=$("#arrCity").val();
				deptStartDate=$("#startDate").val();
				deptEndDate=$("#endDate").val();
				seatClass=$("#seat").val();
				routingType=$('input[name="routingType"]:checked').val();
				var url = '/np/query?deptCity='+deptCity+'&arrCity='+arrCity+'&deptStartDate='+deptStartDate+'&deptEndDate='+deptEndDate+'&seatClass='+seatClass+'&charterType='+charterType+'&routingType='+routingType+'&deptCityName='+deptCityName+'&arrCityName='+arrCityName+'&temp='+Math.random();
				window.parent.addTab({title : "散客预定",url : url});
			});
			$("#queryQw").click(function(){
				var deptCityName = "";
				var arrCityName = "";
				var deptCity="";//出发城市
				var arrCity="";//到达城市
				var deptDate="";//出发日期
				var seatClass="";//舱位
				var charterType="";//类型 1硬切
				var sortType="deptDate";//排序方式
				var routingType="ROUND";//往返类型
				var seatCount="";//座位数
				var deptStartDate = addDate(2);
				charterType=1;
				deptCityName=$("#homecity_name1").val();
				arrCityName=$("#getcity_name1").val();
				deptCity=$("#startCity1").val();
				arrCity=$("#arrCity1").val();
				//deptDate=$("#startDate").val();
				seatCount=$("#seatCount").val();
				seatClass=$("#seat1").val();
				//deptCity=deptCity.replace('{$startCity}','');
				//arrCity=arrCity.replace('{$arrCity}','');
				$("#count").val(seatCount);
				if(arrCity == ""){
					jQuery.messager.alert('提示:','到达城市输入有误!'); 
					return false;
				}
				if(seatClass == ""){
					jQuery.messager.alert('提示:','舱位不能为空!'); 
					return false;
				}
				if(seatCount == ""){
					jQuery.messager.alert('提示:','座位数不能为空!'); 
					return false;
				} 
				var url = '/np/queryQw?deptCity='+deptCity+'&arrCity='+arrCity+'&deptStartDate='+deptStartDate+'&seatClass='+seatClass+'&charterType='+charterType+'&sortType='+sortType+'&seatCount='+seatCount+'&routingType='+routingType+'&deptCityName='+deptCityName+'&arrCityName='+arrCityName+'&temp='+Math.random();
				window.parent.addTab({title : "切位预定",url : url});
			});
		});
		function addDate(days) {
			var d = new Date();
			d.setDate(d.getDate() + days);
			var month = d.getMonth() + 1;
			var day = d.getDate();
			if (month < 10) {
				month = "0" + month;
			}
			if (day < 10) {
				day = "0" + day;
			}
			var val = d.getFullYear() + "-" + month + "-" + day;
			return val;
		};
		function jump(title,url){
			window.parent.addTab({title : title,url : url});
		};
		</script>
</head>
<body >
	<div class="reserveBox">
		<ul class="reserveHeader">
			<li class="redText">航班查询<img src="${ctx}/image/planeSmall.gif"></li>
			<li class="hover active">散客预定</li>
			<li class="hover">切位预定</li>
		</ul>
		<ul class="list" id="reserveSK">
				<li style="line-height: 20px">
		           	 <input type="radio" style="width:15px;" name="routingType" id="routeType1" value="ROUND" checked="checked"><label for="routeType1">往返程</label>
		             <input type="radio" style="width:15px;" name="routingType" id="routeType2" value="TO"><label for="routeType2">单程</label>
		        </li>
		        <li >出发城市： 
		            <input type="text" value="" size="15" id="homecity_name" name="homecity_name" style="width:150px;height: 23px" mod="address|notice" mod_address_source="hotel" mod_address_suggest="" mod_address_reference="startCity" mod_notice_tip="中文/拼音" />
		            <img class="city" src="${ctx}/image/city.gif">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
					<input id="startCity" name="startCity" type="hidden" value="" />
					到达城市：
					<input type="text" value="" size="15" id="getcity_name" name="getcity_name" style="width:150px;height: 23px" mod="address|notice" mod_address_source="hotel"  mod_address_reference="arrCity" mod_notice_tip="中文/拼音" />
					<img class="city" src="${ctx}/image/city.gif">
					<input id="arrCity" name="arrCity" type="hidden" value="" />
		        </li>
		        <li>
					
		        </li>
		        <li class="dateList">
		                                      去程日期：
		             <input type="text" id="startDate" class="textbox" value="${requestScope.deptDate}" onFocus="new WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-\#{%d+2}',maxDate:'#F{$dp.$D(\'endDate\')}'})" style="width: 155px;height: 20px"/>
		             &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
		               	舱位等级：
		                <select data-options="panelHeight:'auto'" id="seat"style="height:23px">
		                	<option value="">请选择</option>
		                    <option value="Y">经济舱</option>
		                    <option value="F">头等舱</option>
		                    <option value="C">商务舱</option>
		                </select>
		        </li>
		        <li><img class="dateImg" src="${ctx}/image/search.gif"><span class="query" id="query">查询</span></li>
		 </ul>
		<ul class="list" id="reserveQW" style="display:none;">
	           <li>出发城市： 
	           		<input type="text" value="" size="15" id="homecity_name1" name="homecity_name1" style="width:150px;height: 23px" mod="address|notice" mod_address_source="hotel" mod_address_suggest="" mod_address_reference="startCity1" mod_notice_tip="中文/拼音" />
	           		<img class="city" src="${ctx}/image/city.gif">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
					<input id="startCity1" name="startCity1" type="hidden" value="" />
					到达城市：
					<input type="text" value="" size="15" id="getcity_name1" name="getcity_name1" style="width:150px;height: 23px" mod="address|notice" mod_address_source="hotel"  mod_address_reference="arrCity1" mod_notice_tip="中文/拼音" />
					<img class="city" src="${ctx}/image/city.gif">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
					<input id="arrCity1" name="arrCity1" type="hidden" value="" />
	          </li>
	          <li>
	               	 舱位等级：
	                <select id="seat1" style="height:23px">
	                	<option value="">请选择</option>
	                    <option value="Y">经济舱</option>
	                    <option value="F">头等舱</option>
	                    <option value="C">商务舱</option>
	                </select>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
	             	   座位数：
	                <input type="text" id="seatCount"  style="width:150px;height: 23px"/>
	            </li>
	            <li>
	            	<img class="dateImg searchImg" src="${ctx}/image/search.gif">
	            	<input type="button" value="查询" class="query" id="queryQw"/>
	            </li>
	   </ul>
	   <img class="planeBig" src="${ctx}/image/planeBig.gif">
	</div>
	<div class="news">
		<ul class="newsHeader">
			<li>热点公告<img src="${ctx}/image/news.gif"></li>
			<li class="right">查看更多</li>
		</ul>
		<ul class="newsContent">
			<li>
				<div class="left newsContent1"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
				<div class="left newsContent1 newsContent2"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
			</li>
			<li>
				<div class="left newsContent1"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
				<div class="left newsContent1 newsContent2"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
			</li>
			<li>
				<div class="left newsContent1"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
				<div class="left newsContent1 newsContent2"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
			</li>
			<li>
				<div class="left newsContent1"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
				<div class="left newsContent1 newsContent2"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
			</li>
			<li>
				<div class="left newsContent1"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
				<div class="left newsContent1 newsContent2"><span class="left">航信10月20日-10月25日之间系统维护通知</span><span class="right">2016-07-03</span></div>
			</li>
		</ul>
	</div>		

<script type="text/javascript" src="${ctx }/jslib/airport/fixdiv.js"></script>
<script type="text/javascript" src="${ctx }/jslib/airport/address.js"></script>
 <script type="text/javascript">
		$(function(){
			var tabs = $('#tt').tabs().tabs('tabs');
			for(var i=0; i<tabs.length; i++){
				tabs[i].panel('options').tab.unbind().bind('mouseenter',{index:i},function(e){
					$('#tt').tabs('select', e.data.index);
				});
			};
		});
	</script>
</body>
</html>